package ModelLayer;



/**
 * The test class ItemTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class ItemTest extends junit.framework.TestCase
{
    /**
     * Default constructor for test class ItemTest
     */
    public ItemTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    protected void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    protected void tearDown()
    {
    }

    public void testCreateItem()
    {
        ModelLayer.Item item1 = new ModelLayer.Item(1000.50, 15.50, "das", "asd", 123, 321, "fff", "eee", null, 555, 999, 777);
    }

    public void testSetItemInformation()
    {
        ModelLayer.Item item1 = new ModelLayer.Item(1500, 4654, "54646", "asd", 54654, 79879, "we", "uyyu", null, 123312, 45645, 1232342);
        item1.setAmountInStock(987);
        item1.setAmountPrOrder(555);
        item1.setBarcode("hej");
        item1.setBuyingPrice(45124);
        item1.setDescription("kamsau");
        item1.setDiscount(25);
        item1.setItemNumber("65665");
        item1.setLocationsNumber("L4");
        item1.setMaxStock(50);
        item1.setMinStock(25);
        item1.setName("Alex");
        item1.setSellingPrice(1500);
        item1.setSupplier(null);
    }


	public void testGetItemInformation()
	{
		ModelLayer.Item item1 = new ModelLayer.Item(5000, 1500, "hej", "hallo", 123, 321, "kamsau", "yamiyugi", null, 1515, 2020, 2000);
		assertEquals(1515, item1.getAmountInStock());
		assertEquals(123, item1.getAmountPrOrder());
		assertSame("", item1.getBarcode());
		assertEquals(5000.0, item1.getBuyingPrice());
		assertSame("yamiyugi", item1.getDescription());
		assertEquals(321, item1.getDiscount());
		assertSame("hej", item1.getItemNumber());
		assertSame("kamsau", item1.getLocationsNumber());
		assertEquals(2000, item1.getMaxStock());
		assertEquals(2020, item1.getMinStock());
		assertEquals(false, item1.getOrderedBySupplier());
		assertSame("hallo", item1.getName());
		assertEquals(1500.0, item1.getSellingPrice());
		assertEquals(null, item1.getSupplier());
	}
}




